@extends('/home/zhuce/zhuce')
@section('title','找回密码')
  @section('content')
    <div class="welland"> 
   <img src="/Home/zhuce/Picture/logewm.gif" alt="" class="EWM" style="" /> 
   <!--LOGO--> 
   <div class="land_logo"> 
    <input type="hidden" value="" id="jihuo" /> 
    <div class="l land_logo_img"> 
     <a class="l" href="http://www.ugoshop.com" target="_blank"></a> 
     <span class="l findlogo"></span> 
    </div> 
    <p class="r kefuphonenum">已经注册，<a target="_blank" href="{{url('/home/login/login')}}">现在登录》</a></p> 
   </div> 
   <!--LOGO OVER--> 
   <!--regnav begin--> 
   <div class="regnav"> 
    <ul> 
     <!-- <li class="regnav1 on"><span class="icon4">手机注册</span></li>  -->
     <li  class="regnav1 on"><span class="icon2">新密码</span></li> 
    </ul> 
   </div> 
   <!--regnav OVER--> 
   <!--框内开始--> 
   <div class="land_con clearfix"> 
    <!--邮箱注册开始--> 
        <form action="{{url('/zhaohui/update')}}" method="post">
        <input type="hidden" name="id" value="{{$id}}">
        <input type="hidden" name="token" value="{{$token}}">
        <div class="item phone-regName"> 
       <span class="l labname1">新密码:</span>
        <div>
        <input style="width: 400px;height: 30px;font-size: 20px;" name="password" type="password" value="{{old('password')}}" />
        <div style="display:none ">请输入6~18位密码</div>
        </div>
       </div>        
       <div class="item phone-regName"> 
       <span class="l labname1">确认密码:</span>
        <div>
        <input style="width: 400px;height: 30px;font-size: 20px;" name="repassword" type="password" />
        <div style="display:none ">请确认密码</div>
        </div>
       </div>      
        <div class="item phone-regName"> 
        <div>
        <span class="l labname1">验证码:</span>
        <input style="width: 80px;height: 30px;font-size: 20px;" name="yanzhengma" type="text" value=""/>
        @if(session('error'))
          <span style="color:red">{{session('error')}}</span>
        @endif
        <div style="padding-left:200px;padding-top:-250px">
        <img src="{{url('/zhuce/vode')}}" name="img" onclick="this.src=this.src+'?a=1'"style="cursor:pointer;padding-top:10px;width: 100px;height:40px" alt=""/>
        </div>
        </div>
       </div>
   
      <div class="item phone-regName" id="itemh2"> 
       <span class="l labname1"></span> 
       <div class="item-ifo l"> 
      <input type="hidden" value="" id="hidden1" /> 
       </div> 
      </div> 
      <div class="item phone-regName" id="itemh3"> 
       <span class="l labname1"></span> 
       <div class="item-ifo l" style="padding-top:30px"> 
        <input type="submit" id="btn1" class="registsubmit" value="" /> 
        <br /> 
        <label>如有疑问请点击<a class="cg" href="/help.html" target="_blank">帮助中心</a>，或拨打客服热线：<em>400-707-0707</em></label> 
       </div> 
      </div> 
      {{csrf_field()}}
     </form> 
    </div> 
   </div>
   <script type="text/javascript" src="/Home/zhuce/Scripts/jquery-1.8.3.min.js"></script>
   <script type="text/javascript">
   //定义全局变量
   var PASS = false;
   var REPASS = false;
   //绑定提交事件
   $('form').submit(function(){
    $('input').trigger('blur');
    if(PASS && REPASS){
      return true;
    }
    return false;
   })
   //获取焦点
   $('input').focus(function(){
      $(this).next().show().css('color','green');
   })
   
   
   //密码失去焦点
  $('input[name=password]').blur(function(){
    var password = $(this).val();
    var reg = /^\w{6,18}$/;
    if(reg.test(password)){
      $(this).next('div').show().html('密码格式正确').css('color','green');
      PASS = true;
    }else{
      $(this).next('div').show().html('密码格式不正确').css('color','red');
      PASS = false;
    }
   })
  //确认密码失去焦点
  $('input[name=repassword]').blur(function(){
    var repass = $(this).val();
    var pass = $('input[name=password]').val();
    //判断密码是否为空
    if(repass == ''){
      $(this).next('div').show().html('密码不能为空').css('color','red');
      REPASS = false;
      return false;
    }
    //判断密码是否一致
    if(repass == pass){
      $(this).next('div').show().html('密码一致').css('color','green');
      REPASS = true;
    }else{
      $(this).next('div').show().html('两次密码不一致').css('color','red');
      REPASS = false;
    }    
  })
 </script>

   <!--框内结束--> 
  </div>

  @endsection